home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / geebee.c < prev    next >
C/C++ Source or Header  |  2000-05-20  |  21KB  |  656 lines

  1. /****************************************************************************
  2.  *
  3.  * geebee.c
  4.  *
  5.  * system driver
  6.  * juergen buchmueller <pullmoll@t-online.de>, jan 2000
  7.  *
  8.  * memory map (preliminary)
  9.  * 0000-0fff ROM1 / ROM0
  10.  * 1000-1fff ROM2
  11.  * 2000-2fff VRAM
  12.  * 3000-3fff CGROM
  13.  * 4000-4fff RAM
  14.  * 5000-5fff IN
  15.  *             A1 A0
  16.  *              0  0      SW0
  17.  *                      D0 COIN1
  18.  *                      D1 COIN2
  19.  *                      D2 START1
  20.  *                      D3 START2
  21.  *                      D4 BUTTON1
  22.  *                      D5 TEST MODE
  23.  *              0  1      SW1
  24.  *                      - not used in Gee Bee
  25.  *                      - digital joystick left/right and button in
  26.  *                        Kaitei Tagara Sagashi (two in Cocktail mode)
  27.  *              1  0      DSW2
  28.  *                      D0    cabinet: 0= upright  1= table
  29.  *                      D1    balls:     0= 3         1= 5
  30.  *                      D2-D3 coinage: 0=1c/1c 1=1c/2c 2=2c/1c 3=free play
  31.  *                      D4-D5 bonus:     0=none, 1=40k     2=70k     3=100k
  32.  *              1  1      VOLIN
  33.  *                      D0-D7 vcount where paddle starts (note: rotated 90 deg!)
  34.  *                      - not used(?) in Kaitei Tagara Sagashi
  35.  * 6000-6fff OUT6
  36.  *             A1 A0
  37.  *              0  0      BALL H
  38.  *              0  1      BALL V
  39.  *              1  0      n/c
  40.  *              1  1      SOUND
  41.  *                      D3 D2 D1 D0       sound
  42.  *                       x  0  0    0  PURE TONE 4V (2000Hz)
  43.  *                       x  0  0    1  PURE TONE 8V (1000Hz)
  44.  *                       x  0  1    0  PURE TONE 16V (500Hz)
  45.  *                       x  0  1    1  PURE TONE 32V (250Hz)
  46.  *                       x  1  0    0  TONE1 (!1V && !16V)
  47.  *                       x  1  0    1  TONE2 (!2V && !32V)
  48.  *                       x  1  1    0  TONE3 (!4V && !64V)
  49.  *                       x  1  1    1  NOISE
  50.  *                       0  x  x    x  DECAY
  51.  *                       1  x  x    x  FULL VOLUME
  52.  * 7000-7fff OUT7
  53.  *             A2 A1 A0
  54.  *              0  0    0 LAMP 1
  55.  *              0  0    1 LAMP 2
  56.  *              0  1    0 LAMP 3
  57.  *              0  1    1 COUNTER
  58.  *              1  0    0 LOCK OUT COIL
  59.  *              1  0    1 BGW
  60.  *              1  1    0 BALL ON
  61.  *              1  1    1 INV
  62.  * 8000-ffff INTA (read FF)
  63.  *
  64.  * TODO:
  65.  * add second controller for cocktail mode and two players?
  66.  *
  67.  ****************************************************************************/
  68.  
  69. #include "driver.h"
  70. #include "vidhrdw/generic.h"
  71.  
  72. /* from machine/geebee.c */
  73. extern int geebee_interrupt(void);
  74. extern int kaitei_interrupt(void);
  75. READ_HANDLER( geebee_in_r );
  76. READ_HANDLER( navalone_in_r );
  77. WRITE_HANDLER( geebee_out6_w );
  78. WRITE_HANDLER( geebee_out7_w );
  79.  
  80. /* from vidhrdw/geebee.c */
  81. extern void geebee_init_palette(unsigned char *sys_palette, unsigned short *sys_colortable, const unsigned char *color_prom);
  82. extern void navalone_init_palette(unsigned char *sys_palette, unsigned short *sys_colortable, const unsigned char *color_prom);
  83.  
  84. extern int geebee_vh_start(void);
  85. extern int navalone_vh_start(void);
  86. extern int kaitei_vh_start(void);
  87. extern int sos_vh_start(void);
  88. extern void geebee_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  89.  
  90. /* from sndhrdw/geebee.c */
  91. WRITE_HANDLER( geebee_sound_w );
  92. extern int geebee_sh_start(const struct MachineSound *msound);
  93. extern void geebee_sh_stop(void);
  94. extern void geebee_sh_update(void);
  95.  
  96. /*******************************************************
  97.  *
  98.  * memory regions
  99.  *
  100.  *******************************************************/
  101.  
  102. static struct MemoryReadAddress readmem[] =
  103. {
  104.     { 0x0000, 0x1fff, MRA_ROM },    /* GeeBee uses only the first 4K */
  105.     { 0x2000, 0x23ff, MRA_RAM },
  106.     { 0x3000, 0x37ff, MRA_ROM },    /* GeeBee uses only the first 1K */
  107.     { 0x4000, 0x40ff, MRA_RAM },
  108.     { 0x5000, 0x5fff, geebee_in_r },
  109.     { -1 }  /* end of table */
  110. };
  111.  
  112. static struct MemoryReadAddress readmem_navalone[] =
  113. {
  114.     { 0x0000, 0x1fff, MRA_ROM },
  115.     { 0x2000, 0x23ff, MRA_RAM },
  116.     { 0x3000, 0x37ff, MRA_ROM },
  117.     { 0x4000, 0x40ff, MRA_RAM },
  118.     { 0x5000, 0x5fff, navalone_in_r },
  119.     { -1 }  /* end of table */
  120. };
  121.  
  122. static struct MemoryWriteAddress writemem[] =
  123. {
  124.     { 0x0000, 0x1fff, MWA_ROM },
  125.     { 0x2000, 0x23ff, videoram_w, &videoram, &videoram_size },
  126.     { 0x2400, 0x27ff, videoram_w }, /* mirror used in kaitei */
  127.     { 0x3000, 0x37ff, MWA_ROM },
  128.     { 0x4000, 0x40ff, MWA_RAM },
  129.     { 0x6000, 0x6fff, geebee_out6_w },
  130.     { 0x7000, 0x7fff, geebee_out7_w },
  131.     { -1 }  /* end of table */
  132. };
  133.  
  134. static struct IOReadPort readport[] =
  135. {
  136.     { 0x50, 0x5f, geebee_in_r },
  137.     { -1 }  /* end of table */
  138. };
  139.  
  140. static struct IOReadPort readport_navalone[] =
  141. {
  142.     { 0x50, 0x5f, navalone_in_r },
  143.     { -1 }  /* end of table */
  144. };
  145.  
  146. static struct IOWritePort writeport[] =
  147. {
  148.     { 0x60, 0x6f, geebee_out6_w },
  149.     { 0x70, 0x7f, geebee_out7_w },
  150.     { -1 }  /* end of table */
  151. };
  152.  
  153. INPUT_PORTS_START( geebee )
  154.     PORT_START        /* IN0 SW0 */
  155.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW, IPT_COIN1   )
  156.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW, IPT_COIN2   )
  157.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW, IPT_START1  )
  158.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW, IPT_START2  )
  159.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  160.     PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
  161.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  162.  
  163.     PORT_START      /* IN1 SW1 */
  164.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  165.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
  166.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  167.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
  168.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  169.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  170.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  171.  
  172.     PORT_START      /* IN2 DSW2 */
  173.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  174.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  175.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail) )
  176.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
  177.     PORT_DIPSETTING(    0x00, "3" )
  178.     PORT_DIPSETTING(    0x02, "5" )
  179.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
  180.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  181.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  182.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  183.     PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
  184.     /* Bonus Life moved to two inputs to allow changing 3/5 lives mode separately */
  185.     PORT_BIT    ( 0x30, 0x00, IPT_UNUSED )
  186.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  187.  
  188.     PORT_START        /* IN3 VOLIN */
  189.     PORT_ANALOG( 0xff, 0x58, IPT_PADDLE | IPF_REVERSE, 30, 15, 0x10, 0xa0 )
  190.  
  191.     PORT_START        /* IN4 FAKE for 3 lives */
  192.     PORT_BIT    ( 0x0f, 0x00, IPT_UNUSED )
  193.     PORT_DIPNAME( 0x30, 0x00, "Bonus Life (3 lives)" )
  194.     PORT_DIPSETTING(    0x10, "40k 80k" )
  195.     PORT_DIPSETTING(    0x20, "70k 140k" )
  196.     PORT_DIPSETTING(    0x30, "100k 200k" )
  197.     PORT_DIPSETTING(    0x00, "None" )
  198.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  199.  
  200.     PORT_START        /* IN5 FAKE for 5 lives */
  201.     PORT_BIT    ( 0x0f, 0x00, IPT_UNUSED )
  202.     PORT_DIPNAME( 0x30, 0x00, "Bonus Life (5 lives)" )
  203.     PORT_DIPSETTING(    0x10, "60k 120k" )
  204.     PORT_DIPSETTING(    0x20, "100k 200k" )
  205.     PORT_DIPSETTING(    0x30, "150k 300k" )
  206.     PORT_DIPSETTING(    0x00, "None" )
  207.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  208.  
  209. INPUT_PORTS_END
  210.  
  211. INPUT_PORTS_START( navalone )
  212.     PORT_START        /* IN0 SW0 */
  213.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW, IPT_COIN1   )
  214.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  215.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW, IPT_START1  )
  216.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW, IPT_START2  )
  217.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  218.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW, IPT_COIN2   )
  219.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  220.  
  221.     PORT_START      /* IN1 SW1 */
  222.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  223.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
  224.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  225.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
  226.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  227.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  228.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  229.  
  230.     PORT_START      /* IN2 DSW2 */
  231.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  232.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  233.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail) )
  234.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
  235.     PORT_DIPSETTING(    0x00, "2" )
  236.     PORT_DIPSETTING(    0x02, "3" )
  237.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  238.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  239.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  240.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  241.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  242.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  243.     PORT_DIPNAME( 0x38, 0x10, DEF_STR( Coinage ) )
  244.     PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
  245.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )
  246.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  247.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  248.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  249.  
  250.     PORT_START        /* IN3 VOLIN */
  251.     PORT_BIT    ( 0xff, 0x58, IPT_UNUSED )
  252.  
  253.     PORT_START        /* IN4 two-way digital joystick */
  254.     PORT_BIT    ( 0x01, 0x00, IPT_JOYSTICK_LEFT )
  255.     PORT_BIT    ( 0x02, 0x00, IPT_JOYSTICK_RIGHT )
  256.  
  257. INPUT_PORTS_END
  258.  
  259. INPUT_PORTS_START( kaitei )
  260.     PORT_START        /* IN0 SW0 */
  261.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW,    IPT_COIN1 )
  262.     PORT_BIT    ( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  263.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW,    IPT_START1 )
  264.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW,    IPT_START2 )
  265.     PORT_BIT    ( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  266.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  267.     PORT_BIT    ( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  268.     PORT_BIT    ( 0x80, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  269.  
  270.     PORT_START      /* IN1 SW1 */
  271.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW,    IPT_JOYSTICK_RIGHT )
  272.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW,    IPT_JOYSTICK_LEFT )
  273.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW,    IPT_BUTTON1 )
  274.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW,    IPT_JOYSTICK_RIGHT | IPF_COCKTAIL )
  275.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW,    IPT_JOYSTICK_LEFT | IPF_COCKTAIL )
  276.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW,    IPT_BUTTON1 | IPF_COCKTAIL )
  277.     PORT_BIT    ( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  278.     PORT_BIT    ( 0x80, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  279.  
  280.     PORT_START      /* IN2 DSW2 */
  281.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
  282.     PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
  283.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail) )
  284.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
  285.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  286.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  287.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
  288.     PORT_DIPSETTING(    0x04, "5" )
  289.     PORT_DIPSETTING(    0x00, "7" )
  290.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  291.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  292.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  293.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  294.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  295.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  296.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  297.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  298.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  299.     PORT_BIT    ( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  300.     PORT_BIT    ( 0x80, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  301.  
  302.     PORT_START        /* IN3 VOLIN */
  303.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  304.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  305.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  306.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  307.     PORT_BIT    ( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  308.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  309.     PORT_BIT    ( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  310.     PORT_BIT    ( 0x80, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  311.  
  312. INPUT_PORTS_END
  313.  
  314. INPUT_PORTS_START( kaitein )
  315.     PORT_START        /* IN0 SW0 */
  316.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW,    IPT_COIN1 )
  317.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW,    IPT_COIN2 )
  318.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW,    IPT_START1 )
  319.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW,    IPT_START2 )
  320.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW,    IPT_BUTTON1 )
  321.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  322.     PORT_BIT    ( 0x40, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  323.     PORT_BIT    ( 0x80, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  324.  
  325.     PORT_START      /* IN1 SW1 */
  326.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  327.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  328.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  329.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  330.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  331.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  332.     PORT_BIT    ( 0x40, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  333.     PORT_BIT    ( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  334.  
  335.     PORT_START      /* IN2 DSW2 */
  336.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  337.     PORT_DIPSETTING(    0x00, "2" )
  338.     PORT_DIPSETTING(    0x01, "3" )
  339.     PORT_DIPSETTING(    0x02, "4" )
  340.     PORT_DIPSETTING(    0x03, "5" )
  341.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  342.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  343.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  344.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  345.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  346.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  347.     PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) )
  348.     PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
  349.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )
  350.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  351.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  352.     PORT_BIT    ( 0x40, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  353.     PORT_BIT    ( 0x80, IP_ACTIVE_LOW,    IPT_UNKNOWN )
  354.  
  355.     PORT_START        /* IN3 VOLIN */
  356.     PORT_BIT    ( 0xff, 0x58, IPT_UNUSED )
  357.  
  358.     PORT_START        /* IN4 two-way digital joystick */
  359.     PORT_BIT    ( 0x01, 0x00, IPT_JOYSTICK_LEFT )
  360.     PORT_BIT    ( 0x02, 0x00, IPT_JOYSTICK_RIGHT )
  361.  
  362. INPUT_PORTS_END
  363.  
  364. INPUT_PORTS_START( sos )
  365.     PORT_START      /* IN0 SW0 */
  366.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW, IPT_COIN1   )
  367.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  368.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW, IPT_START1  )
  369.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW, IPT_START2  )
  370.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  371.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW, IPT_COIN2   )
  372.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  373.  
  374.     PORT_START      /* IN1 SW1 */
  375.     PORT_BIT    ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  376.     PORT_BIT    ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
  377.     PORT_BIT    ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  378.     PORT_BIT    ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
  379.     PORT_BIT    ( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  380.     PORT_BIT    ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  381.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  382.  
  383.     PORT_START      /* IN2 DSW2 */
  384.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  385.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  386.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail) )
  387.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
  388.     PORT_DIPSETTING(    0x00, "2" )
  389.     PORT_DIPSETTING(    0x02, "3" )
  390.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  391.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  392.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  393.     PORT_DIPNAME( 0x38, 0x08, DEF_STR( Coinage ) )
  394.     PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
  395.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
  396.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
  397.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  398.     PORT_BIT    ( 0xc0, 0x00, IPT_UNUSED )
  399.  
  400.     PORT_START      /* IN3 VOLIN */
  401.     PORT_ANALOG( 0xff, 0x58, IPT_PADDLE | IPF_REVERSE, 30, 15, 0x10, 0xa0 )
  402.  
  403. INPUT_PORTS_END
  404.  
  405. static struct GfxLayout charlayout_1k =
  406. {
  407.     8, 8,                               /* 8x8 pixels */
  408.     128,                               /* 128 codes */
  409.     1,                                   /* 1 bit per pixel */
  410.     {0},                               /* no bitplanes */
  411.     /* x offsets */
  412.     {0,1,2,3,4,5,6,7},
  413.     /* y offsets */
  414.     {0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8},
  415.     8 * 8                               /* eight bytes per code */
  416. };
  417.  
  418. static struct GfxDecodeInfo gfxdecodeinfo_1k[] =
  419. {
  420.     { REGION_CPU1, 0x3000, &charlayout_1k, 0, 4 },
  421.     {-1}                               /* end of array */
  422. };
  423.  
  424. static struct GfxLayout charlayout_2k =
  425. {
  426.     8, 8,                              /* 8x8 pixels */
  427.     256,                               /* 256 codes */
  428.     1,                                 /* 1 bit per pixel */
  429.     {0},                               /* no bitplanes */
  430.     /* x offsets */
  431.     {0,1,2,3,4,5,6,7},
  432.     /* y offsets */
  433.     {0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8},
  434.     8 * 8                              /* eight bytes per code */
  435. };
  436.  
  437. static struct GfxDecodeInfo gfxdecodeinfo_2k[] =
  438. {
  439.     { REGION_CPU1, 0x3000, &charlayout_2k, 0, 4 },
  440.     {-1}                               /* end of array */
  441. };
  442.  
  443. static struct CustomSound_interface custom_interface =
  444. {
  445.     geebee_sh_start,
  446.     geebee_sh_stop,
  447.     geebee_sh_update
  448. };
  449.  
  450. static struct MachineDriver machine_driver_geebee =
  451. {
  452.     /* basic machine hardware */
  453.     {
  454.         {
  455.             CPU_8080,
  456.             18432000/9,         /* 18.432 Mhz / 9 */
  457.             readmem,writemem,readport,writeport,
  458.             geebee_interrupt,1    /* one interrupt per frame */
  459.         }
  460.     },
  461.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  462.     1,      /* single CPU, no need for interleaving */
  463.     0,
  464.  
  465.     /* video hardware */
  466.     34*8, 32*8, { 0*8, 34*8-1, 2*8, 30*8-1 },
  467.     gfxdecodeinfo_1k,  /* gfxdecodeinfo */
  468.     3+32768, 4*2,        /* extra colors for the overlay */
  469.     geebee_init_palette,
  470.  
  471.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  472.     0,
  473.     geebee_vh_start,
  474.     generic_vh_stop,
  475.     geebee_vh_screenrefresh,
  476.  
  477.     /* sound hardware */
  478.     0, 0, 0, 0,
  479.     {
  480.         {
  481.             SOUND_CUSTOM,
  482.             &custom_interface
  483.         }
  484.     }
  485. };
  486.  
  487.  
  488. static struct MachineDriver machine_driver_navalone =
  489. {
  490.     /* basic machine hardware */
  491.     {
  492.         {
  493.             CPU_8080,
  494.             18432000/9,         /* 18.432 Mhz / 9 */
  495.             readmem_navalone,writemem,readport_navalone,writeport,
  496.             geebee_interrupt,1    /* one interrupt per frame */
  497.         }
  498.     },
  499.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  500.     1,      /* single CPU, no need for interleaving */
  501.     0,
  502.  
  503.     /* video hardware */
  504.     34*8, 32*8, { 0*8, 34*8-1, 2*8, 30*8-1 },
  505.     gfxdecodeinfo_2k,  /* gfxdecodeinfo */
  506.     3+32768, 4*2,        /* extra colors for the overlay */
  507.     navalone_init_palette,
  508.  
  509.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  510.     0,
  511.     navalone_vh_start,
  512.     generic_vh_stop,
  513.     geebee_vh_screenrefresh,
  514.  
  515.     /* sound hardware */
  516.     0, 0, 0, 0,
  517.     {
  518.         {
  519.             SOUND_CUSTOM,
  520.             &custom_interface
  521.         }
  522.     }
  523. };
  524.  
  525.  
  526.  
  527. static struct MachineDriver machine_driver_kaitei =
  528. {
  529.     /* basic machine hardware */
  530.     {
  531.         {
  532.             CPU_8080,
  533.             18432000/9,         /* 18.432 Mhz / 9 */
  534.             readmem_navalone,writemem,readport_navalone,writeport,
  535.             kaitei_interrupt,1    /* one interrupt per frame */
  536.         }
  537.     },
  538.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  539.     1,      /* single CPU, no need for interleaving */
  540.     0,
  541.  
  542.     /* video hardware */
  543.     34*8, 32*8, { 0*8, 34*8-1, 2*8, 30*8-1 },
  544.     gfxdecodeinfo_2k,  /* gfxdecodeinfo */
  545.     3+32768, 4*2,        /* extra colors for the overlay */
  546.     navalone_init_palette,
  547.  
  548.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  549.     0,
  550.     kaitei_vh_start,
  551.     generic_vh_stop,
  552.     geebee_vh_screenrefresh,
  553.  
  554.     /* sound hardware */
  555.     0, 0, 0, 0,
  556.     {
  557.         {
  558.             SOUND_CUSTOM,
  559.             &custom_interface
  560.         }
  561.     }
  562. };
  563.  
  564. static struct MachineDriver machine_driver_sos =
  565. {
  566.     /* basic machine hardware */
  567.     {
  568.         {
  569.             CPU_8080,
  570.             18432000/9,         /* 18.432 Mhz / 9 */
  571.             readmem_navalone,writemem,readport_navalone,writeport,
  572.             geebee_interrupt,1    /* one interrupt per frame */
  573.         }
  574.     },
  575.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  576.     1,      /* single CPU, no need for interleaving */
  577.     0,
  578.  
  579.     /* video hardware */
  580.     34*8, 32*8, { 0*8, 34*8-1, 2*8, 30*8-1 },
  581.     gfxdecodeinfo_2k,  /* gfxdecodeinfo */
  582.     3+32768, 4*2,        /* extra colors for the overlay */
  583.     navalone_init_palette,
  584.  
  585.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  586.     0,
  587.     sos_vh_start,
  588.     generic_vh_stop,
  589.     geebee_vh_screenrefresh,
  590.  
  591.     /* sound hardware */
  592.     0, 0, 0, 0,
  593.     {
  594.         {
  595.             SOUND_CUSTOM,
  596.             &custom_interface
  597.         }
  598.     }
  599. };
  600.  
  601.  
  602.  
  603. ROM_START( geebee )
  604.     ROM_REGION( 0x10000, REGION_CPU1 )
  605.     ROM_LOAD( "geebee.1k",      0x0000, 0x1000, 0x8a5577e0 )
  606.     ROM_LOAD( "geebee.3a",      0x3000, 0x0400, 0xf257b21b )
  607. ROM_END
  608.  
  609. ROM_START( geebeeg )
  610.     ROM_REGION( 0x10000, REGION_CPU1 )
  611.     ROM_LOAD( "geebee.1k",      0x0000, 0x1000, 0x8a5577e0 )
  612.     ROM_LOAD( "geebeeg.3a",     0x3000, 0x0400, 0xa45932ba )
  613. ROM_END
  614.  
  615. ROM_START( navalone )
  616.     ROM_REGION( 0x10000, REGION_CPU1 )
  617.     ROM_LOAD( "navalone.p1",    0x0000, 0x0800, 0x5a32016b )
  618.     ROM_LOAD( "navalone.p2",    0x0800, 0x0800, 0xb1c86fe3 )
  619.     ROM_LOAD( "navalone.chr",   0x3000, 0x0800, 0xb26c6170 )
  620. ROM_END
  621.  
  622. ROM_START( kaitei )
  623.     ROM_REGION( 0x10000, REGION_CPU1 )
  624.     ROM_LOAD( "kaitei_7.1k",    0x0000, 0x0800, 0x32f70d48 )
  625.     ROM_RELOAD(                 0x0800, 0x0800 )
  626.     ROM_LOAD( "kaitei_1.1m",    0x1000, 0x0400, 0x9a7ab3b9 )
  627.     ROM_LOAD( "kaitei_2.1p",    0x1400, 0x0400, 0x5eeb0fff )
  628.     ROM_LOAD( "kaitei_3.1s",    0x1800, 0x0400, 0x5dff4df7 )
  629.     ROM_LOAD( "kaitei_4.1t",    0x1c00, 0x0400, 0xe5f303d6 )
  630.     ROM_LOAD( "kaitei_5.bin",   0x3000, 0x0400, 0x60fdb795 )
  631.     ROM_LOAD( "kaitei_6.bin",   0x3400, 0x0400, 0x21399ace )
  632. ROM_END
  633.  
  634. ROM_START( kaitein )
  635.     ROM_REGION( 0x10000, REGION_CPU1 )
  636.     ROM_LOAD( "kaitein.p1",     0x0000, 0x0800, 0xd88e10ae )
  637.     ROM_LOAD( "kaitein.p2",     0x0800, 0x0800, 0xaa9b5763 )
  638.     ROM_LOAD( "kaitein.chr",    0x3000, 0x0800, 0x3125af4d )
  639. ROM_END
  640.  
  641. ROM_START( sos )
  642.     ROM_REGION( 0x10000, REGION_CPU1 )
  643.     ROM_LOAD( "sos.p1",         0x0000, 0x0800, 0xf70bdafb )
  644.     ROM_LOAD( "sos.p2",         0x0800, 0x0800, 0x58e9c480 )
  645.     ROM_LOAD( "sos.chr",        0x3000, 0x0800, 0x66f983e4 )
  646. ROM_END
  647.  
  648.  
  649. GAME ( 1978, geebee,   0,        geebee,   geebee,   0, ROT90, "Namco", "Gee Bee" )
  650. GAME ( 1978, geebeeg,  geebee,     geebee,   geebee,   0, ROT90, "[Namco] (Gremlin license)", "Gee Bee (Gremlin)" )
  651. GAMEX( 1980, navalone, 0,        navalone, navalone, 0, ROT90, "Namco", "Navalone", GAME_IMPERFECT_SOUND )
  652. GAME ( 1980, kaitei,   0,        kaitei,   kaitei,   0, ROT90, "K.K. Tokki", "Kaitei Takara Sagashi" )
  653. GAME ( 1980, kaitein,  kaitei,     kaitei,   kaitein,  0, ROT90, "Namco", "Kaitei Takara Sagashi (Namco)" )
  654. GAMEX( 1980, sos,       0,        sos,      sos,      0, ROT90, "Namco", "SOS", GAME_IMPERFECT_SOUND )
  655.  
  656.